const lang = {
    common: {
        appName: '流量狗',
        appShortName: '流量狗',
        login: '登录',
        logout: '退出登录',
        // username: '用户名',
        // password: '密码',
        // remember: '记住密码',
        // forget: '忘记密码',
        backHome: '返回主页',
        notFound: '找不到页面',
        getVerifyCode: '获取验证码',
        afterSeconds: '{second}s后重试',
        codeSent: '验证码已发送',
        mobile: '手机号',
        verifyCode: '验证码',
        pleaseEnter: '请输入',
        action: '操作',
        status: '状态',
        view: '查看详情',
        hot: '热门'
    },
    rules: {
        mobile: '请输入手机号码',
        verifyCode: '验证码应为4位数字',
    },
    messageBox: {
        title: '提示',
        loginSuccess: '登录成功',
        loginError: '登录已失效',
        logout: '您确定要退出登录吗？',
        networkError: '前方拥挤，请稍后再试 {code}'
    },
    router: {
        login: '用户登录',
        home: "首页",
        introduction: "产品介绍",
        about: "关于我们",
        account: '我的流量狗',
        accountBuy: '账号购买',
        accountDetail: '账号详情',
        accountStatistics: '收益统计',
        confirmorder: '确认订单',
        order: '我的订单',
        withdraw: '提现管理',
    },
    home: {},
    introduction: {},
    about: {},
    account: {
        table: {
            accountID: '账号',
            accountType: '类型',
            totalIncome: '总收益(美元)',
            expiredTime: '到期时间',
            renewal: '续费'
        },
        type: {
            1: '个人版',
            2: '专业版',
            9: '企业版'
        },
        memo: {
            1: '',
            2: '',
            9: '',
        },
        status: {
            0: '离线',
            1: '正常',
            2: '过期'
        }
    },
    order: {},
    withdraw: {}
}


function flattenObject(obj: any, parentKey: string = '', result: { [key: string]: any } = {}): { [key: string]: any } {
    for (let key in obj) {
        if (obj.hasOwnProperty(key)) {
            const newKey = parentKey ? `${parentKey}.${key}` : key;
            if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {
                flattenObject(obj[key], newKey, result);
            } else {
                result[newKey] = obj[key];
            }
        }
    }
    return result;
}

console.log(JSON.stringify(flattenObject(lang)))

export default lang;
